<div>
  <app-team-nav
    [navInfo]="navInfo"
  ></app-team-nav>
  <div class="container">
    <div class="team_info">
      <div class="setting" *ngIf="team.adminGuid==userGuid" nzTitle="设置" nzPlacement="topCenter" nz-tooltip
           (click)="team.isEdit = !team.isEdit" [ngClass]="{'setting1':team.isEdit}"></div>
      <div class="team_info_head">
        <div style="display: inline-block;position: relative">
          <div class="team_name" *ngIf="!team.isModifyTeamName">{{team.name}}</div>
          <img *ngIf="team.isEdit&&!team.isModifyTeamName" src="/assets/img/image/white_modify_logo.png" alt=""
               class="modify_logo" width="17" height="17" (click)="team.isModifyTeamName = !team.isModifyTeamName">
        </div>
        <input type="text" [(ngModel)]="team.name" *ngIf="team.isModifyTeamName">
        <div class="modify_btn" *ngIf="team.isModifyTeamName" (click)="modifyTeamName(team)">
          <img src="/assets/img/image/modify_logo.png" alt="" width="25" height="25">
        </div>
        <div class="team_create_date">{{team.createTime|toDate|date:'yyyy年MM月dd日'}}创建</div>
      </div>
      <ul class="clearfix">
        <li class="f_l">
          <div class="team_administrator">
            <div class="administrator_img"
                 [style.background-image]="'url('+(team.Cover?(readImgUrl+team.Cover):defaultImg)+')'"></div>
            <div class="administrator_info">
              <div class="little_title">团队管理员</div>
              <div class="big_title admin_name" style="position: relative">{{team.administrator}}
                <img src="/assets/img/image/white_modify_logo.png" alt=""
                     style="vertical-align: middle;cursor: pointer; margin-left: 5px;position: absolute;top: 8px;"
                     width="17" height="17" *ngIf="team.isEdit" (click)="openAdminSetting(team)">
              </div>
            </div>
          </div>
        </li>
        <li class="f_l">
          <div class="team_buy_package">
            <div class="package_logo" *ngIf="team.packageArr.length!==0"
                 [style.background-image]="'url('+readImgUrl+team.packageArr[0][0].cover+')'"></div>
            <div class="package_logo_null" *ngIf="team.packageArr.length==0"></div>
            <div class="buy_package_info">
              <div class="little_title">已购买教案包</div>
              <div class="big_title">{{team.packageArr.length}}个</div>
            </div>
          </div>
        </li>
        <li class="f_l">
          <div class="team_buy_app">
            <div class="app_logo" *ngIf="team.appArr.length!==0">
              <img [src]="readImgUrl+team.appArr[0].CoverUrl" alt="" width="36" height="35">
            </div>
            <div class="app_logo_null" *ngIf="team.appArr.length==0"></div>
            <div class="buy_app_info">
              <div class="little_title">已购买应用</div>
              <div class="big_title">{{team.appArr.length}}个</div>
            </div>
          </div>
        </li>
      </ul>
      <div class="accredit_ids">
        <img src="../../../assets/img/image/members_logo.png" alt="" width="15" height="15" class="members_logo"
             [ngClass]="{'members_logo1':team.isTransform}"
             (click)="team.isLimitHeight=!team.isLimitHeight;team.isTransform=!team.isTransform">
        <div style="width:20%;padding-left: 5px">
          <img src="/assets/img/image/icon1.png" alt="" style="margin-bottom: 10px" width="32" height="20">
          <div style="font-size: 14px;color:#333333;">
            已加入{{team.haveAccreditMembers.length}}({{team.limitNumber}})个账号
          </div>
          <div style="font-size: 12px;color: #999999" *ngIf="!team.isDated">
            {{team.endTime|toDate|date:'yyyy年MM月dd日'}}到期
          </div>
          <div style="font-size: 12px;color: #999999" *ngIf="team.isDated">已到期</div>
        </div>
        <div class="clearfix" [ngClass]="{'no_limit_height':!team.isLimitHeight,'team_members':team.isLimitHeight}">
          <div class="member f_l" *ngFor="let member of team.haveAccreditMembers;let i = index">
            <div class="member_img"
                 [style.background-image]="'url('+(member.Cover?(readImgUrl+member.Cover):defaultImg)+')'"></div>
            <div class="member_name">{{member.UserName?member.UserName:member.Name}}</div>
            <div class="delete_icon" *ngIf="team.isEdit" (click)="removeMembers(team,i)">×</div>
          </div>
          <div class="add_team_member f_l" *ngIf="team.isEdit" (click)="openAddAccredit(team)">+</div>
        </div>

      </div>
    </div>
    <app-admin-setting
      *ngIf="team.openAdminSeeting"
      [team]="team"
      (onTeam)="closeAdminSetting($event)"
    >
    </app-admin-setting>
    <app-add-accredit
      *ngIf="team.openAccredit"
      (onTeam)="onCloseAddAccredit($event,team)"
      [team]="team"
    >
    </app-add-accredit>
    <div>
      <div class="team_package">
        <div class="team_package_title">
          <span class="big_title" style="display: inline-block;margin-right: 3px">团队的教案包</span>
          <span class="little_title" style="color: #999999">联系您所在区域的购买团队<a href=""
                                                                           style="text-decoration: underline;color: #666666" onclick="return false">销售经理或代理商</a>购买团队教案包</span>
        </div>
        <div class="team_package_content" *ngFor="let packet of team.packageArr;let i =index;">
          <div class="setting" *ngIf="team.adminGuid==userGuid" nzTitle="设置" nzPlacement="topCenter" nz-tooltip
               (click)="packet[0].isEdit = !packet[0].isEdit  " [ngClass]="{'setting1':packet[0].isEdit}"></div>
          <div class="package_type">
            <div class="package">
              <div class="package_img" [style.background-image]="'url('+readImgUrl+packet[0].cover+')'"
                   (click)="goPacket(packet[0].packetGuid,packet[0].name,packet[0].isEdit)"></div>
              <div class="package_info">
                <div class="package_name">
                  <div style="font-size: 20px;color: #333333">{{packet[0].name}}</div>
                  <div style="font-size: 12px;color: #333333">{{packet[0].enName}}</div>
                  <div style="font-size: 12px;color: #999999">{{packet[0].publisher}}</div>
                </div>
                <img src="/assets/img/image/duplicate_logo.png" alt="" class="duplicate_logo" width="22" height="23"
                     *ngIf="packet[0].isEdit"
                     (click)="createDuplicate(packet[0].teamGuid,packet[0].packetGuid,packet[0].name,i)">
              </div>
            </div>
            <div class="duplicates">
              <div class="first_list_duplicates clearfix">
                <div class="duplicate f_l" *ngFor="let duplicate of firstDuplicateArr[i];let duplicateIndex = index ">
                  <div class="duplicate_img"
                       [style.background-image]="'url('+readImgUrl+duplicate.cover+')'"
                       (click)="goPacket(duplicate.packetGuid,duplicate.name,packet[0].isEdit)"></div>
                  <div class="duplicate_info">
                    <div class="duplicate_name" style="color: #333333">{{duplicate.name}}</div>
                    <div class="duplicate_tip " style="color: #F38299" *ngIf="!packet[0].isEdit">副本</div>
                    <div class="logo">
                      <img src="/assets/img/image/little_modify_logo.png" alt="" width="20" height="21"
                           style="margin-right: 10px;cursor: pointer" *ngIf="packet[0].isEdit"
                           (click)="modifyDuplicate(duplicate,i,duplicateIndex,1)">
                      <img src="/assets/img/image/delete_logo.png" alt="" width="20" height="21"
                           style="cursor: pointer" *ngIf="packet[0].isEdit"
                           (click)="deleteDuplicate(duplicate.packetGuid,duplicate.name,i,duplicateIndex)">
                    </div>
                  </div>
                  <app-modify-duplicate
                    *ngIf="duplicate.isModify"
                    [duplicate]="duplicate"
                    (onDuplicate)="closeModifyDuplicate($event)"
                  >

                  </app-modify-duplicate>
                </div>
              </div>
              <div class="last_list_duplicates clearfix">
                <div class="duplicate f_l" *ngFor="let duplicate of lastDuplicateArr[i];let duplicateIndex = index">
                  <div class="duplicate_img"
                       [style.background-image]="'url('+readImgUrl+duplicate.cover+')'"
                       (click)="goPacket(duplicate.packetGuid,duplicate.name,packet[0].isEdit)"></div>
                  <div class="duplicate_info">
                    <div class="duplicate_name" style="color: #333333">{{duplicate.name}}</div>
                    <div class="duplicate_tip " style="color: #F38299" *ngIf="!packet[0].isEdit">副本</div>
                    <div class="logo">
                      <img src="/assets/img/image/little_modify_logo.png" alt="" width="20" height="21"
                           style="margin-right: 10px;cursor: pointer" *ngIf="packet[0].isEdit"
                           (click)="modifyDuplicate(duplicate,i,duplicateIndex,2)">
                      <img src="/assets/img/image/delete_logo.png" alt="" width="20" height="21"
                           style="cursor: pointer" *ngIf="packet[0].isEdit"
                           (click)="deleteDuplicate(duplicate.packetGuid,duplicate.name,i,duplicateIndex)">
                    </div>
                  </div>
                  <app-modify-duplicate
                    *ngIf="duplicate.isModify"
                    [duplicate]="duplicate"
                    (onDuplicate)="closeModifyDuplicate($event)"
                  >
                  </app-modify-duplicate>
                </div>
                <div class="more_duplicate" (click)="moreDuplicate(packet[0].name,packet[0].packetGuid)"
                     *ngIf="team.showMoreDuplicate[i]">
                  <img src="/assets/img/image/more_package_logo.png" alt="" width="67" height="68">
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="team_app">
        <div class="team_app">
          <div class="team_app_title">
            <span class="big_title" style="display: inline-block;margin-right: 3px">团队的应用</span>
            <span class="little_title" style="color: #999999">联系您所在区域的购买团队<a href=""
                                                                             style="text-decoration: underline;color: #666666" onclick="return false">销售经理或代理商</a>购买团队教案包</span>
          </div>
          <div class="team_app_content">
            <div class="apps clearfix">
              <div class="app f_l customer-item-content" *ngFor="let app of team.appArr"
                   (click)="goApp(app.AppUrl,app.AppName)">
                <div class="app_cover" [style.background-image]="'url('+readImgUrl+app.CoverUrl+')'"></div>
                <div class="app_info">
                  <div class="app_name">{{app.AppName}}</div>
                  <div class="app_english_name">{{app.EnAppName}}</div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
